<template>
	<view>
		<view class="box" v-for="(item,index) in recordList" :key="index">
			<view class="boxName">
				<text>{{item.FRemark}}</text>
				<text v-if="item.FDataType != 3" class="text">
					<text v-if="item.FDataType == -3">1次</text>
					<text v-else>{{(item.FAmount).toFixed(2)}}元 {{item.FSetAmount!=0?'赠送¥'+(item.FSetAmount).toFixed(2):''}}</text>
				</text>
				<text v-else class="text">{{(item.MemberTimeAmt).toFixed(2)}}元</text>
			</view>
			<text>{{item.FDate}}</text>
			<text style="float: right;">{{item.FPaymentName}}</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				recordList: [],
				loadingType: 'more', //加载更多状态
				pageindex: 0,
			}
		},
		onLoad(){
			this.detail();
		},
		onReachBottom(){
			this.detail();
		},
		methods: {
			// 
			detail(){
				if(this.loadingType==='nomore'){
					return;
				}
				this.pageindex++;
				this.$util.util('MemberShop/GetMemberDeposit',{PageIndex: this.pageindex,PageSize: 10,},'GET').then(res=>{
					console.log(res)
					this.recordList = this.recordList.concat(res);
					this.loadingType = this.recordList.length >= this.recordList[0].FRowCount ? 'nomore' : 'more';
				}).catch(error=> console.log(error));
			}
		}
	}
</script>

<style lang='scss'>
	.box{
		width: 100%;
		height: auto;
		line-height: 50upx;
		padding: 20upx 20upx 10upx 30upx;
		border-bottom: 2upx solid #F9F9F9;
		font-size: 28upx;
		color: #707070;
		.boxName{
			width: 100%;
			height: 50rpx;
		}
		.text{
			margin-left: 50rpx;
		}
		/* text:first-child{
			width: 100%;
			display: block;
		}
		text:last-child{
			float: right;
			margin-right: 50upx;
		} */
	}
</style>